package com.bjsxt.model;

/**
 * @Description:
 * @ClassName: TradePlate
 * @Author: chenyu
 * @Date: 2025/3/20 17:07
 */

import com.bjsxt.disruptor.Order;
import com.bjsxt.disruptor.OrderDirection;
import lombok.Data;
import org.bouncycastle.util.Arrays;

import java.math.BigDecimal;
import java.util.LinkedList;

/**
 * 交易的盘口数据,以后前端可以查询该数据
 */
@Data
public class TradePlate {

    /**
     * 判断数据的详情
     */
    private LinkedList<TradePlateItem> items = new LinkedList<>();
    /**
     * 最大支持的深度
     */
    private int maxDepth = 100;

    /**
     * 订单的方向
     */
    private OrderDirection direction;

    /**
     * 交易对
     */
    private String symbol;

    public TradePlate(String symbol, OrderDirection direction) {
        this.symbol = symbol;
        this.direction = direction;
    }

    public void remove(Order marker) {
        remove(marker, marker.getAmount().subtract(marker.getTradedAmount()));

    }

    public void remove(Order marker, BigDecimal tradedAmount) {
        if (items == null || items.size() == 0)
            return;
        if (marker.getOrderDirection() != direction.getCode())
            return;
        Iterator<>
    }
}
